
import com.yuangou.ecp.biz.transengine.sqlsession.YGPageEntity;
import com.yuangou.ecp.biz.transengine.sqlsession.YGResultHandler;
import java.util.List;

/**
 * ${table.tableCommentCn}（${table.tableCommentEn}）
 */
public interface ${table.tableNameCamel}Mapper {

    /**
     * 根据主键查询
     */
    ${table.tableNameCamel}PO selectByPrimaryKey(
      <#list table.primaryKey as pk>
              ${table.fields?filter(f -> f.nameCamel == pk)[0].type} ${pk}<#if pk_has_next>, </#if>
      </#list>
    );

    /**
     * 根据主键更新
     */
    int updateByPrimaryKey(${table.tableNameCamel}PO entity);

    /**
     * 根据主键选择性更新
     */
    int updateByPrimaryKeySelective(${table.tableNameCamel}PO entity);

    /**
     * 根据主键删除
     */
    int deleteByPrimaryKey(
      <#list table.primaryKey as pk>
              ${table.fields?filter(f -> f.nameCamel == pk)[0].type} ${pk}<#if pk_has_next>, </#if>
      </#list>
    );

    /**
     * 插入（选择性字段）
     */
    int insertSelective(${table.tableNameCamel}PO entity);

    /**
     * 插入
     */
    int insert(${table.tableNameCamel}PO entity);

    /**
     * 分页查询
     */
    List<${table.tableNameCamel}PO> selectByPage(YGPageEntity pageEntity, ${table.tableNameCamel}PO entity);

    /**
     * 结果处理查询
     */
    void selectResultHandler(${table.tableNameCamel}PO entity, YGResultHandler resultHandler);
}

<#--
示例数据结构：
{
  "table": {
    "tableNameCamel": "AcmCddt",
    "tableNameSnake": "t_acm_cddt",
    "tableCommentCn": "存款收支明细表",
    "tableCommentEn": "Deposit and Withdrawal Details Table",
    "fields": [
      {"nameCamel": "jrnNo", "nameSnake": "jrn_no", "type": "String", "commentCn": "流水号", "commentEn": "Journal number"},
      {"nameCamel": "sysDt", "nameSnake": "sys_dt", "type": "String", "commentCn": "系统日期", "commentEn": "System date"}
    ],
    "primaryKey": ["jrnNo", "jrnSeq", "acDt"],
    "indexes": [
      {"name": "NI1_T_ACM_CDDT", "fields": ["sepCd", "acDt"]},
      {"name": "NI2_T_ACM_CDDT", "fields": ["sysDt", "sepCd"]}
    ]
  }
}
--> 